package com.resou.reader.api.service;

import com.resou.reader.api.entry.Result;
import com.resou.reader.api.entry.ShareTimeBean;
import com.resou.reader.api.entry.SubSidyDetailBean;

import io.reactivex.Observable;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface SubSidyService {
    /**
     * 取消自动购买
     *
     * @param token
     * @return
     */
    @POST("/subsidy/detail")
    Observable<Result<SubSidyDetailBean>> quearSubSidyDetail(@Query("token") String token);

    /**
     * 取消自动购买
     *
     * @param token
     * @return
     */
    @POST("/subsidy/modelChange")
    Observable<Result<SubSidyDetailBean>> setSubSidyModel(@Query("token") String token, @Query("readType") int readType);

    /**
     * 获取用户总省钱和某一个章节省钱接口
     *
     * @param token
     * @param bookId
     * @param chapterId
     * @return
     */
    @POST("/book/getUserPrice")
    Observable<Result<ShareTimeBean>> getUserPrice(@Query("token") String token, @Query("bookId") String bookId, @Query("chapterId") String chapterId);

    /**
     * 省钱模式增加书籍省钱接口
     *
     * @param token
     * @param bookId    书籍ID
     * @param chapterId 章节ID
     * @param length    书籍内容字数
     * @return
     */
    @POST("/book/addBookChapterPrice")
    Observable<Result<String>> addBookChapterPrice(@Query("token") String token, @Query("bookId") String bookId, @Query("chapterId") String chapterId, @Query("length") int length);


}
